package cn.hchaojie.camp.day06;

import java.util.Timer;
import java.util.TimerTask;

public class DemoAbstract {
	public static void main(String[] args) {
		Timer timer = new Timer();
		
		// 使用匿名内部类，直接创建一个抽象类
		timer.schedule(new TimerTask() {
			@Override
			public void run() {
				System.out.println("====");
			}
		}, 1000, 1000);

		timer.schedule(new TimerTask() {
			@Override
			public void run() {
				System.out.println("+++++");
			}
		}, 1000, 1000);
	}
}
